import 'package:flutter/material.dart';

class TextDecorationWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('TextDecocration')),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: [
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: Text('''
演示Text.style.decoration(实质是划线),以下属性均为`TextStyle`的子属性
1.根据位置(decoration): overline(上横线) lineThrough(中横线) underline(下横线) combine(混合)
2.支持类型(decorationStyle): double(双横线) dashed(虚线) dotted(点) solid(实线) wavy(波浪线)
3.可配置颜色(color): Colors.pink
4.可配置线条粗细(decorationThickness): 4
''', softWrap: true),
          ),
          // SizedBox(height: 8),
          // Text('TextStyle(backgroundColor: Colors.pink)',
          //     style: TextStyle(backgroundColor: Colors.pink)),
          // SizedBox(height: 8),
          // Text('TextStyle(background: Paint()..color = Colors.pink)',
          //     style: TextStyle(background: Paint()..color = Colors.pink)),
          // SizedBox(height: 8),
          // Text('TextStyle(color: Colors.red)',
          //     style: TextStyle(color: Colors.red)),
          // SizedBox(height: 8),
          // Text('TextStyle(foreground: Paint()..color = Colors.pink)',
          //     style: TextStyle(foreground: Paint()..color = Colors.red)),
          SizedBox(height: 8),
          Text('decoration: TextDecoration.overline',
              style: TextStyle(decoration: TextDecoration.overline)),
          SizedBox(height: 8),
          Text('decoration: TextDecoration.lineThrough',
              style: TextStyle(decoration: TextDecoration.lineThrough)),
          SizedBox(height: 8),
          Text('decoration: TextDecoration.underline',
              style: TextStyle(decoration: TextDecoration.underline)),
          SizedBox(height: 8),
          Text('decoration: TextDecoration.combine[overline | underline]',
              style: TextStyle(
                  decoration: TextDecoration.combine(
                      [TextDecoration.overline, TextDecoration.underline]))),
          SizedBox(height: 8),
          Text('decorationStyle: TextDecorationStyle.double(双横线)',
              style: TextStyle(
                  decorationColor: Colors.blue,
                  decorationStyle: TextDecorationStyle.double,
                  decoration: TextDecoration.underline)),
          SizedBox(height: 8),
          Text('decorationStyle: TextDecorationStyle.dashed(虚线)',
              style: TextStyle(
                  decorationColor: Colors.blue,
                  decorationStyle: TextDecorationStyle.dashed,
                  decoration: TextDecoration.underline)),
          SizedBox(height: 8),
          Text('decorationStyle: TextDecorationStyle.dotted(点)',
              style: TextStyle(
                  decorationColor: Colors.blue,
                  decorationStyle: TextDecorationStyle.dotted,
                  decoration: TextDecoration.underline)),
          SizedBox(height: 8),
          Text('decorationStyle: TextDecorationStyle.solid(实线)',
              style: TextStyle(
                  decorationColor: Colors.blue,
                  decorationStyle: TextDecorationStyle.solid,
                  decoration: TextDecoration.underline)),
          SizedBox(height: 8),
          Text('decorationStyle: TextDecorationStyle.wavy(波浪线)',
              style: TextStyle(
                  decorationColor: Colors.blue,
                  decorationStyle: TextDecorationStyle.wavy,
                  decoration: TextDecoration.underline)),
          SizedBox(height: 8),
          Text('decorationColor: Colors.red(装饰颜色)',
              style: TextStyle(
                  decorationColor: Colors.red,
                  decorationStyle: TextDecorationStyle.wavy,
                  decoration: TextDecoration.underline)),
          Text('decorationThickness: 4()',
              style: TextStyle(
                  decorationThickness: 4,
                  decorationColor: Colors.red,
                  decorationStyle: TextDecorationStyle.solid,
                  decoration: TextDecoration.underline)),
        ],
      ),
    );
  }
}
